package com.gmail.at.dengtooling.util;

/**
 * Some constants
 * 
 * @author Deng Tooling
 * @version 1.0
 * @see http://www.rfc-editor.org/rfc/rfc4250.txt
 */
public class Constant {
	// Message Numbers
	public final static int	SSH_MSG_DISCONNECT								= 1;	// 0x01 [SSH-TRANS]
	public final static int	SSH_MSG_IGNORE									= 2;	// 0x02 [SSH-TRANS]
	public final static int	SSH_MSG_UNIMPLEMENTED							= 3;	// 0x03 [SSH-TRANS]
	public final static int	SSH_MSG_DEBUG									= 4;	// 0x04 [SSH-TRANS]
	public final static int	SSH_MSG_SERVICE_REQUEST							= 5;	// 0x05 [SSH-TRANS]
	public final static int	SSH_MSG_SERVICE_ACCEPT							= 6;	// 0x06 [SSH-TRANS]
	
	public final static int	SSH_MSG_KEXINIT									= 20;	// 0x14 [SSH-TRANS]
	public final static int	SSH_MSG_NEWKEYS									= 21;	// 0x15 [SSH-TRANS]
	public final static int	SSH_MSG_KEXDH_INIT								= 30;	// 		[SSH-TRANS]
	public final static int	SSH_MSG_KEXDH_REPLY								= 31;	// 		[SSH-TRANS]	
	
	public static final int SSH_MSG_KEX_DH_GEX_REQUEST_OLD 					= 30;
	public static final int SSH_MSG_KEX_DH_GEX_REQUEST 						= 34;
	public static final int SSH_MSG_KEX_DH_GEX_GROUP 						= 31;
	public static final int SSH_MSG_KEX_DH_GEX_INIT 						= 32;
	public static final int SSH_MSG_KEX_DH_GEX_REPLY 						= 33;
	
	public final static int	SSH_MSG_USERAUTH_REQUEST						= 50;	// 0x32 [SSH-USERAUTH]
	public final static int	SSH_MSG_USERAUTH_FAILURE						= 51;	// 0x33 [SSH-USERAUTH]
	public final static int	SSH_MSG_USERAUTH_SUCCESS						= 52;	// 0x34 [SSH-USERAUTH]
	public final static int	SSH_MSG_USERAUTH_BANNER							= 53;	// 0x35 [SSH-USERAUTH]
	
	public final static int	SSH_MSG_GLOBAL_REQUEST							= 80;	// 0x50 [SSH-CONNECT]
	public final static int	SSH_MSG_REQUEST_SUCCESS							= 81;	// 0x51 [SSH-CONNECT]
	public final static int	SSH_MSG_REQUEST_FAILURE							= 82;	// 0x52 [SSH-CONNECT]
	public final static int	SSH_MSG_CHANNEL_OPEN							= 90;	// 0x5A [SSH-CONNECT]
	public final static int	SSH_MSG_CHANNEL_OPEN_CONFIRMATION				= 91;	// 0x5B [SSH-CONNECT]
	public final static int	SSH_MSG_CHANNEL_OPEN_FAILURE					= 92;	// 0x5C [SSH-CONNECT]
	public final static int	SSH_MSG_CHANNEL_WINDOW_ADJUST					= 93;	// 0x5D [SSH-CONNECT]
	public final static int	SSH_MSG_CHANNEL_DATA							= 94;	// 0x5E [SSH-CONNECT]
	public final static int	SSH_MSG_CHANNEL_EXTENDED_DATA					= 95;	// 0x5F [SSH-CONNECT]
	public final static int	SSH_MSG_CHANNEL_EOF								= 96;	// 0x60 [SSH-CONNECT]
	public final static int	SSH_MSG_CHANNEL_CLOSE							= 97;	// 0x61 [SSH-CONNECT]
	public final static int	SSH_MSG_CHANNEL_REQUEST							= 98;	// 0x62 [SSH-CONNECT]
	public final static int	SSH_MSG_CHANNEL_SUCCESS							= 99;	// 0x63 [SSH-CONNECT]
	public final static int	SSH_MSG_CHANNEL_FAILURE							= 100;	// 0x64 [SSH-CONNECT]

	// Disconnection Messages Reason Codes
	public final static int	SSH_DISCONNECT_HOST_NOT_ALLOWED_TO_CONNECT		= 1;
	public final static int	SSH_DISCONNECT_PROTOCOL_ERROR					= 2;
	public final static int	SSH_DISCONNECT_KEY_EXCHANGE_FAILED				= 3;
	public final static int	SSH_DISCONNECT_RESERVED							= 4;
	public final static int	SSH_DISCONNECT_MAC_ERROR						= 5;
	public final static int	SSH_DISCONNECT_COMPRESSION_ERROR				= 6;
	public final static int	SSH_DISCONNECT_SERVICE_NOT_AVAILABLE			= 7;
	public final static int	SSH_DISCONNECT_PROTOCOL_VERSION_NOT_SUPPORTED	= 8;
	public final static int	SSH_DISCONNECT_HOST_KEY_NOT_VERIFIABLE			= 9;
	public final static int	SSH_DISCONNECT_CONNECTION_LOST					= 10;
	public final static int	SSH_DISCONNECT_BY_APPLICATION					= 11;
	public final static int	SSH_DISCONNECT_TOO_MANY_CONNECTIONS				= 12;
	public final static int	SSH_DISCONNECT_AUTH_CANCELLED_BY_USER			= 13;
	public final static int	SSH_DISCONNECT_NO_MORE_AUTH_METHODS_AVAILABLE	= 14;
	public final static int	SSH_DISCONNECT_ILLEGAL_USER_NAME				= 15;

	// Channel Connection Failure Reason Codes
	public final static int	SSH_OPEN_ADMINISTRATIVELY_PROHIBITED			= 1;
	public final static int	SSH_OPEN_CONNECT_FAILED							= 2;
	public final static int	SSH_OPEN_UNKNOWN_CHANNEL_TYPE					= 3;
	public final static int	SSH_OPEN_RESOURCE_SHORTAGE						= 4;

	// Extended Channel Data Transfer data_type_code
	public final static int	SSH_EXTENDED_DATA_STDERR						= 1;

	// Pseudo-Terminal Encoded Terminal Modes
	public final static int	TTY_OP_END										= 0;	//	Indicates end of options.
	public final static int	VINTR											= 1;	//	Interrupt character; 255 if none.  Similarly for the other characters.  Not all of these characters are supported on all systems.
	public final static int	VQUIT											= 2;	//	The quit character (sends SIGQUIT signal on POSIX systems).
	public final static int	VERASE											= 3;	//	Erase the character to left of the cursor.
	public final static int	VKILL											= 4;	//	Kill the current input line.
	public final static int	VEOF											= 5;	//	End-of-file character (sends EOF from the terminal).
	public final static int	VEOL											= 6;	//	End-of-line character in addition to carriage return and/or linefeed.
	public final static int	VEOL2											= 7;	//	Additional end-of-line character.
	public final static int	VSTART											= 8;	//	Continues paused output (normally control-Q).
	public final static int	VSTOP											= 9;	//	Pauses output (normally control-S).
	public final static int	VSUSP											= 10;	//	Suspends the current program.
	public final static int	VDSUSP											= 11;	//	Another suspend character.
	public final static int	VREPRINT										= 12;	//	Reprints the current input line.
	public final static int	VWERASE											= 13;	//	Erases a word left of cursor.
	public final static int	VLNEXT											= 14;	//	Enter the next character typed literally, even if it is a special character
	public final static int	VFLUSH											= 15;	//	Character to flush output.
	public final static int	VSWTCH											= 16;	//	Switch to a different shell layer.
	public final static int	VSTATUS											= 17;	//	Prints system status line (load, command, pid, etc).
	public final static int	VDISCARD										= 18;	//	Toggles the flushing of terminal output.
	public final static int	IGNPAR											= 30;	//	The ignore parity flag.  The parameter SHOULD be 0 if this flag is FALSE, and 1 if it is TRUE.
	public final static int	PARMRK											= 31;	//	Mark parity and framing errors.
	public final static int	INPCK											= 32;	//	Enable checking of parity errors.
	public final static int	ISTRIP											= 33;	//	Strip 8th bit off characters.
	public final static int	INLCR											= 34;	//	Map NL into CR on input.
	public final static int	IGNCR											= 35;	//	Ignore CR on input.
	public final static int	ICRNL											= 36;	//	Map CR to NL on input.
	public final static int	IUCLC											= 37;	//	Translate uppercase characters to lowercase.
	public final static int	IXON											= 38;	//	Enable output flow control.
	public final static int	IXANY											= 39;	//	Any char will restart after stop.
	public final static int	IXOFF											= 40;	//	Enable input flow control.
	public final static int	IMAXBEL											= 41;	//	Ring bell on input queue full.
	public final static int	ISIG											= 50;	//	Enable signals INTR, QUIT, [D]SUSP.
	public final static int	ICANON											= 51;	//	Canonicalize input lines.
	public final static int	XCASE											= 52;	//	Enable input and output of uppercase characters by preceding their lowercase equivalents with "\".
	public final static int	ECHO											= 53;	//	Enable echoing.
	public final static int	ECHOE											= 54;	//	Visually erase chars.
	public final static int	ECHOK											= 55;	//	Kill character discards current line.
	public final static int	ECHONL											= 56;	//	Echo NL even if ECHO is off.
	public final static int	NOFLSH											= 57;	//	Don't flush after interrupt.
	public final static int	TOSTOP											= 58;	//	Stop background jobs from output.
	public final static int	IEXTEN											= 59;	//	Enable extensions.
	public final static int	ECHOCTL											= 60;	//	Echo control characters as ^(Char).
	public final static int	ECHOKE											= 61;	//	Visual erase for line kill.
	public final static int	PENDIN											= 62;	//	Retype pending input.
	public final static int	OPOST											= 70;	//	Enable output processing.
	public final static int	OLCUC											= 71;	//	Convert lowercase to uppercase.
	public final static int	ONLCR											= 72;	//	Map NL to CR-NL.
	public final static int	OCRNL											= 73;	//	Translate carriage return to newline (output).
	public final static int	ONOCR											= 74;	//	Translate newline to carriage return-newline (output).
	public final static int	ONLRET											= 75;	//	Newline performs a carriage return (output).
	public final static int	CS7												= 90;	//	7 bit mode.
	public final static int	CS8												= 91;	//	8 bit mode.
	public final static int	PARENB											= 92;	//	Parity enable.
	public final static int	PARODD											= 93;	//	Odd parity, else even.
	public final static int	TTY_OP_ISPEED									= 128;	//	Specifies the input baud rate in bits per second.
	public final static int	TTY_OP_OSPEED									= 129;	//	Specifies the output baud rate in bits per second.
	
	public static final String[] packetsNames = new String[101];

	static
	{
		packetsNames[1] = "SSH_MSG_DISCONNECT";
		packetsNames[2] = "SSH_MSG_IGNORE";
		packetsNames[3] = "SSH_MSG_UNIMPLEMENTED";
		packetsNames[4] = "SSH_MSG_DEBUG";
		packetsNames[5] = "SSH_MSG_SERVICE_REQUEST";
		packetsNames[6] = "SSH_MSG_SERVICE_ACCEPT";

		packetsNames[20] = "SSH_MSG_KEXINIT";
		packetsNames[21] = "SSH_MSG_NEWKEYS";

		packetsNames[30] = "SSH_MSG_KEXDH_INIT";
		packetsNames[31] = "SSH_MSG_KEXDH_REPLY/SSH_MSG_KEX_DH_GEX_GROUP";
		packetsNames[32] = "SSH_MSG_KEX_DH_GEX_INIT";
		packetsNames[33] = "SSH_MSG_KEX_DH_GEX_REPLY";
		packetsNames[34] = "SSH_MSG_KEX_DH_GEX_REQUEST";

		packetsNames[50] = "SSH_MSG_USERAUTH_REQUEST";
		packetsNames[51] = "SSH_MSG_USERAUTH_FAILURE";
		packetsNames[52] = "SSH_MSG_USERAUTH_SUCCESS";
		packetsNames[53] = "SSH_MSG_USERAUTH_BANNER";

		packetsNames[80] = "SSH_MSG_GLOBAL_REQUEST";
		packetsNames[81] = "SSH_MSG_REQUEST_SUCCESS";
		packetsNames[82] = "SSH_MSG_REQUEST_FAILURE";

		packetsNames[90] = "SSH_MSG_CHANNEL_OPEN";
		packetsNames[91] = "SSH_MSG_CHANNEL_OPEN_CONFIRMATION";
		packetsNames[92] = "SSH_MSG_CHANNEL_OPEN_FAILURE";
		packetsNames[93] = "SSH_MSG_CHANNEL_WINDOW_ADJUST";
		packetsNames[94] = "SSH_MSG_CHANNEL_DATA";
		packetsNames[95] = "SSH_MSG_CHANNEL_EXTENDED_DATA";
		packetsNames[96] = "SSH_MSG_CHANNEL_EOF";
		packetsNames[97] = "SSH_MSG_CHANNEL_CLOSE";
		packetsNames[98] = "SSH_MSG_CHANNEL_REQUEST";
		packetsNames[99] = "SSH_MSG_CHANNEL_SUCCESS";
		packetsNames[100] = "SSH_MSG_CHANNEL_FAILURE";
	}

}